<template>
  <el-container class="common-layout">
    <el-header class="header-box">
      <layout-header></layout-header>
    </el-header>
    <el-container>
      <el-aside class="aside-box">
        <layout-menu></layout-menu>
      </el-aside>
      <el-container>
        <el-header class="router-box">
          <layout-tabs></layout-tabs>
        </el-header>
        <el-main class="main-box">
          <router-view v-slot="{ Component }">
            <keep-alive :include="keepRouter">
              <component :is="Component" :key="$route.name"/>
            </keep-alive>
          </router-view>
        </el-main>
        <layout-footer></layout-footer>
      </el-container>
    </el-container>
  </el-container>
</template>

<script setup lang="ts">
import layoutHeader from "./header/index.vue";
import layoutFooter from "./footer/index.vue";
import layoutMenu from "./menus/index.vue"
import layoutTabs from "./tabs/index.vue"
import { useRoutingTagStore, } from "/@/store/index";

const keepRouter=computed(() => useRoutingTagStore().activeRouter);
</script>

<style scoped lang="less">
.common-layout {
  width: 100%;
  height: 100%;

  .menu-box {
    height: 100%;

    .title {
      font-size: 14px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #4E5969
    }
  }
  .aside-box {
    width: 210px;
    height: calc(100% - 94px);
    position: fixed;
    top: 62px;
    left: 0;
    box-sizing: border-box;
    padding-bottom: 40px;
  }

  .header-box {
    padding: 0;
    width: 100%;
    height: 62px;
    position: fixed;
    background-color: #fff;
    top: 0;
    left: 0;
    z-index: 99;
  }

  .main-box {
    background: #f0f2f5;
    position: relative;
    margin-left: 210px;
    margin-top: 94px;
    width: calc(100% - 210px);
    height: calc(100% - 94px);
    overflow-y: auto;
  }
}

.router-box {
  position: fixed;
  width: calc(100% - 210px);
  top: 62px;
  left: 210px;
  height: 33px;
  background: #fff;
  // display: flex;
  align-items: center;
  padding: 1px 10px;
  z-index: 98;
  // width: 100%;

  &:deep(.el-tabs) {
    height: 32px;
    --el-tabs-header-height: 32px;
    line-height: 32px;
    border-bottom: none;
  }

  &:deep(.el-tabs--card > .el-tabs__header .el-tabs__nav) {
    border-radius: 0;
    border-top: none;
    border-bottom: none;
  }

  &:deep(.el-tabs__header) {
    margin: 0;

    .el-tabs__item {
      height: 32px;
      line-height: 32px;
      border-bottom: none;
    }

    .el-tabs__nav-prev {
      line-height: 32px;
    }

    .el-tabs__nav-next {
      line-height: 32px;
    }

    .el-tabs__item:focus.is-active.is-focus:not(:active) {
      box-shadow: none;
    }
  }
}
</style>
